package com.one.shopping.adapter;

import android.content.Context;

import com.one.shopping.R;
import com.one.shopping.entity.OrdersModule;
import com.one.shopping.util.CommonUtils;

/**
 * @author 柯尊诚
 * @version 1.0
 * @date 创建时间：2016/1/9 18:26
 */
public class OrdersAdapter extends CommonAdapter<OrdersModule>{

    public OrdersAdapter(Context context, int layoutId) {
        super(context, layoutId);
    }

    @Override
    protected void convert(ViewHolder vh, OrdersModule orders) {
        vh.setText(R.id.orders_list_id_tv, orders.getId() + "");
        if (!CommonUtils.isNullOrEmpty(orders.getCreateTime()))
            vh.setText(R.id.orders_list_time_tv, orders.getCreateTime());
        vh.setText(R.id.orders_list_total_tv, orders.getTotal() + "");
        if (!CommonUtils.isNullOrEmpty(orders.getCardId()))
            vh.setText(R.id.orders_list_user_tv, orders.getUserId() + "");
    }
}
